<html>
<head>
<title>URL example</title>
<script type="text/javascript" src="../src/main/js/loader.js"></script>
<script type="text/javascript">

	var Parser = load('core.url.Parser');
    var Encoder = load('core.url.Encoder');

	function init() {
		
		with (document.getElementById('info')) {
			var info = Parser.parse(document.location.toString());
			innerHTML =
'URL Scheme: ' + info.scheme + '<br />\
Server Host: ' + info.host + '<br />\
Server Port: ' + info.port + '<br />\
Username: ' + info.user + '<br />\
Password: ' + info.password + '<br />\
Request Path: ' + info.path + '<br />\
Query String: ' + info.query + '<br />\
Page Fragment: ' + info.fragment + '<br />';
		}
		
		with (document.getElementById('enc')) {
			innerHTML = Encoder.encode(document.location.toString());
		}
	}
	
</script>
</head>

<body onload="init()">

<h3>URL information:</h3>
<span id="info"></span>

<h3>Encoded:</h3>
<span id="enc"></span>

</body>
</html>